const Device = require('../models/device')

exports.findAll = function (para, callback) {
  Device.findAll(para).then(devices => {
        let res = devices.map(item => {
            return item.get({
                plain:true
            })
        })
        callback(res);
    })
}

exports.findById = async function(id, callback) {
  Device.findByPk(id).then(device => {
    callback(device)
  })
}
